#include "XpensItem.h"

XpensItem::XpensItem()
{
	forSpec = new ItemSpec;
}

bool XpensItem::record(){
//	int stat;
    if (forSpec -> normalRecord()) return true;
	return false;
/*	cin >> stat;
	switch (stat){
           case 0: forStatus = Expensed;
                   break;
           case 1: forStatus = Debt;
                   break;
           default:break;
           }*/
}

void XpensItem::writefile(ofstream& outfile){
	forSpec -> writefile(outfile);
//	outfile >> forstatus >> ' ';
	outfile.flush();
}


ItemSpec* XpensItem::getItemspec(){
	return forSpec;
}

Status XpensItem::getStatus(){
	return forstatus;
}

bool XpensItem::checkEmpty()
{
    if (forSpec -> getName() == "")
	return true;
	return false;
}

void XpensItem::record_from_file(ifstream& infile, streampos address)
{
	forSpec -> record_from_file(infile, address);
}